/* Check JER_BM_To_old_schedule_Dumb(). */
#include <stdio.h>
#include "jerasure.h"
#include "reed_sol.h"

int main( int argc, char** argv )
{
	int *old_bitmatrix;
	int *old_matrix;
	int** old_schedule;
	int m = atoi( argv[1] );
	int k = atoi( argv[2] );
	int w = atoi( argv[3] );
	int i;

	old_matrix = reed_sol_vandermonde_coding_matrix( k, m, w );
	old_bitmatrix = jerasure_matrix_to_bitmatrix( k, m, w, old_matrix );
	if( old_bitmatrix != NULL )
		jerasure_print_bitmatrix( old_bitmatrix, m*w, k*w, w );
	old_schedule = jerasure_smart_bitmatrix_to_schedule( k, m, w, old_bitmatrix );

	for( i = 0; old_schedule[i][0] != -1; i++ )
	{
		fprintf( stdout, "<%d,%d,%d,%d,%d>\n", old_schedule[i][4], 
				old_schedule[i][0], old_schedule[i][1], old_schedule[i][2], 
				old_schedule[i][3] );
	}

	return 0;
}
